<?php

class Util_autor {

	private function crypt_function($password, $seed) {
		if (!is_null($seed))
			return crypt($password, $seed);
		else
			return crypt($password);
	}

	public function get_encrypted($password) {
		return $this->crypt_function($password, NULL);
	}
	
	public function is_password_encrypted($clear_password, $saved_password) {
		
		$cript_password = $this->crypt_function($clear_password, $saved_password);
		
		return ($cript_password == $saved_password);
		
	}
}

?>